<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%
	String baseP = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ "/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>居住证办理进度查询</title>
    <link type="text/css" href="<c:url value='/static/common/css/wechat-common.css'/>" rel="stylesheet"/>
    <style type="text/css">
        .main {
            font-size: 1.6em;
            margin: 8px;
        }
        .main .form {
            height: 50px;
            line-height: 50px;
            border: 1px solid #dddddd;
            width: 100%;
            border-radius: 3px;
        }
        .main .form .label {
            height: 50px;
            line-height: 50px;
            color: #157dfb;
            text-indent: 0.8em;
            float: left;
            width: 100px;
        }
        .main .form .element {
            height: 50px;
            line-height: 50px;
            margin-left: 105px;
            display: block;
        }
        .main .form .element input {
            color: #666;
            font-family: "微软雅黑";
            text-indent: 0.3em;
            border: 0px;
            width: 98%;
            font-size: 1.0em;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .main .btn:active {
            background-color: #3300ff;
            cursor: hand;
        }
        #result {
            min-height: 6em;
            margin: 5px 10px;
            line-height: 2;
            height: 2em;
            color: #837D7D;
        }
    </style>
</head>
<body>
<div class="main">
    <div class="form">
        <span class="label">身份证号：</span>
        <span class="element"><input id="txt_case" class="no-border" type="text" placeholder="请输入身份证号"/></span>
    </div>
    <div><a id="btn_query" class="btn simple no-border">查 询</a></div>
    <div id="result" style="display: none;">
        <div>
            <span>姓名：</span>
            <span id="xm"></span>
        </div>
        <div>
            <span>性别：</span>
            <span id="xb"></span>
        </div>
        <div>
            <span>居住证状态：</span>
            <span id="jzzt"></span>
        </div>
        <div>
            <span>是否领证：</span>
            <span id="sflz"></span>
        </div>
        <div>
            <span>现居住地址：</span>
            <span id="jzzdz"></span>
        </div>
        <div>
            <span>户籍所在地：</span>
            <span id="hjszd"></span>
        </div>
        <div>
            <span>居住证号：</span>
            <span id="jzzh"></span>
        </div>
    </div>
</div>
<script src="<c:url value='/static/theme/police/js/jquery-2.1.1.min.js'/>" type="text/javascript"></script>
<script src="<c:url value='/static/theme/police/js/common.js'/>" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#btn_query").click(function (event) {
            var idcard = $("#txt_case").val().trim();
            if (idcard == null || idcard == "") {
                toast("请输入身份证号", 1000);
                return;
            }
            if (idcard == "421126198510273813" || idcard == "320405198812272824") {
                toast("没有查询到相应的数据");
                return;
            }
            $.ajax({
                url: "http://221.224.13.5:8190/econsole/api/query/progress/residence/" + idcard,
                timeout: 6000,
                type: "get",
                beforeSend: function () {
                    loading();
                },
                success: function (resp) {
                    if (resp && resp.succ) {
                        var obj = resp.data;
                        $("#xm").html(obj.姓名);
                        $("#xb").html(obj.性别);
                        $("#jzzt").html(obj.居住证状态);
                        $("#sflz").html(obj.是否领居住证);
                        $("#jzzdz").html(obj.现居住地址);
                        $("#hjszd").html(obj.户籍所在地);
                        $("#jzzh").html(obj.居住证号);
                        $("#result").show();
                        finish();
                    } else {
                        $("#result").hide();
                        finish("没有查询到相应的数据");
                    }
                },
                error: function () {
                    finish("查询失败");
                }
            });
            event.stopPropagation();
            return false;
        });
    });
</script>
</body>
</html>